import { Link } from '@brillout/docpress'

[Vite](https://vite.dev) should only be loaded in development (or when building). Loading it in production is unnecessary and significantly bloats the production process.

In production:
- Make sure you don't load the [`vite` package](https://www.npmjs.com/package/vite) nor <Link href="/vite-plugin">Vike's Vite plugin</Link>.
- Make sure you don't call <Link href="/createDevMiddleware">`createDevMiddleware()`</Link>. (The development middleware isn't needed in production.)
  > You can import `createDevMiddleware` in production, but make sure you don't call it.
  > ```js
  > // Environment: production
  > import { createDevMiddleware } from 'vike/server' // ✅ You can import it
  > createDevMiddleware()                             // ❌ You shouldn't call it
  > ```

In development, if you use a server without <Link href="/vike-photon">`vike-photon`</Link> (i.e. you <Link href="/integration#manual-integration">manually integrate your server</Link>), you must use <Link href="/createDevMiddleware">`createDevMiddleware()`</Link> in order to add the development middleware to your server. (If you use `vike-photon`, the development middleware is added automatically and you don't need to use `createDevMiddleware()`.)


## See also

- <Link href="/NODE_ENV" />
